﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<System.Collections.Generic.IEnumerable<WebMvc.Models.Sala>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Salas
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Salas</h2>
    
    <% if (Model.Any())
       { %>
       <table style="margin-top: 10px;">
           <thead>
               <tr>
                   <th>#</th>
                   <th>Nombre</th>
                   <th>Creada en OM</th>
                   <th>Detalles</th>
               </tr>
           </thead>
           <tbody>
               <% foreach (var sala in Model)
                  { %>
                  <tr>
                      <td><%= sala.Id %></td>
                      <td><%= sala.Nombre %></td>
                      <td style="text-align: center">
                          <%= sala.IdOpenMeetings.HasValue ? "SI" : "NO" %>
                      </td>
                      <td style="text-align: center">
                          <%= Html.ActionLink("Ver", "Ver", "Salas", new {id = sala.Id }, null) %>
                      </td>
                  </tr>
               <% } %>
           </tbody>
       </table>
       
    <% }
       else
       { %>
       <p>No hay salas creadas.</p>    
    <% } %>
    
</asp:Content>
